package com.yxb.order.service.impl;

import java.util.List;
import com.yxb.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yxb.order.mapper.TeachingOrderMapper;
import com.yxb.order.domain.TeachingOrder;
import com.yxb.order.service.ITeachingOrderService;

/**
 * 教学订单合约Service业务层处理
 * 
 * @author 林德炫
 * @date 2025-03-04
 */
@Service
public class TeachingOrderServiceImpl implements ITeachingOrderService 
{
    @Autowired
    private TeachingOrderMapper teachingOrderMapper;

    /**
     * 查询教学订单合约
     * 
     * @param orderId 教学订单合约主键
     * @return 教学订单合约
     */
    @Override
    public TeachingOrder selectTeachingOrderByOrderId(Long orderId)
    {
        return teachingOrderMapper.selectTeachingOrderByOrderId(orderId);
    }

    /**
     * 查询教学订单合约列表
     * 
     * @param teachingOrder 教学订单合约
     * @return 教学订单合约
     */
    @Override
    public List<TeachingOrder> selectTeachingOrderList(TeachingOrder teachingOrder)
    {
        return teachingOrderMapper.selectTeachingOrderList(teachingOrder);
    }

    /**
     * 新增教学订单合约
     * 
     * @param teachingOrder 教学订单合约
     * @return 结果
     */
    @Override
    public int insertTeachingOrder(TeachingOrder teachingOrder)
    {
        teachingOrder.setCreateTime(DateUtils.getNowDate());
        return teachingOrderMapper.insertTeachingOrder(teachingOrder);
    }

    /**
     * 修改教学订单合约
     * 
     * @param teachingOrder 教学订单合约
     * @return 结果
     */
    @Override
    public int updateTeachingOrder(TeachingOrder teachingOrder)
    {
        return teachingOrderMapper.updateTeachingOrder(teachingOrder);
    }

    /**
     * 批量删除教学订单合约
     * 
     * @param orderIds 需要删除的教学订单合约主键
     * @return 结果
     */
    @Override
    public int deleteTeachingOrderByOrderIds(Long[] orderIds)
    {
        return teachingOrderMapper.deleteTeachingOrderByOrderIds(orderIds);
    }

    /**
     * 删除教学订单合约信息
     * 
     * @param orderId 教学订单合约主键
     * @return 结果
     */
    @Override
    public int deleteTeachingOrderByOrderId(Long orderId)
    {
        return teachingOrderMapper.deleteTeachingOrderByOrderId(orderId);
    }
}
